import { createStore, applyMiddleware } from "redux";
import thunk from "redux-thunk";
import { composeWithDevTools } from "redux-devtools-extension";
import { combineReducers } from "@reduxjs/toolkit";
import reducer from "./common/reducer";
import { countSlice } from "./reduxTooltik/slices";
import actionLog from "./middleware/actionLog";
const rootReducer = combineReducers({
  base: reducer,
  counter: countSlice.reducer,
});
const composeEnhancers = composeWithDevTools({
  // options like actionSanitizer, stateSanitizer
});
const store = createStore(
  rootReducer,
  composeEnhancers(applyMiddleware(thunk, actionLog))
);
export type RootState = ReturnType<typeof store.getState>;
export default store;
